package com.yoshino.memento.game;

/**
 * @author yoshino
 **/
public class Client {
    public static void main(String[] args) {
        GameRole gameRole = new GameRole();
        gameRole.setVit(100);
        gameRole.setDef(100);

        System.out.println("初始状态");
        gameRole.display();


        // 保存当前状态
        Caretaker caretaker = new Caretaker();
        caretaker.setMemento(gameRole.createMemento());

        System.out.println("更新后");
        gameRole.setVit(30);
        gameRole.setDef(30);

        gameRole.display();

        System.out.println("恢复后");
        gameRole.recoverGameRoleFromMemento(caretaker.get());
        gameRole.display();
    }
}
